//
// Created by yorkc on 2023/12/18.
//

#ifndef BASE_WSKSERVER_H
#define BASE_WSKSERVER_H
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
typedef websocketpp::server<websocketpp::config::asio> server;
class wskserver {
public:
    wskserver();
    void on_open(websocketpp::connection_hdl hdl);
    void on_close(websocketpp::connection_hdl hdl);
    void handmsg(websocketpp::connection_hdl hdl, server::message_ptr ms);
    void sendmsg(websocketpp::connection_hdl hdl, websocketpp::frame::opcode::value ops,const std::string & msgcontent);
    void run();
private:
    server wbserver_endpoint;
};


#endif //BASE_WSKSERVER_H
